home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / PHONEFIX.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  853b  |  28 lines

  1. ' PHONEFIX.BAS
  2. ' This program uses two fixed-length string arrays to record names and
  3. '   telephone numbers.
  4.  
  5. OPTION BASE 1                         ' set lower bound of array to 1
  6.  
  7. CLS
  8.                                       ' get number of names
  9. INPUT "How many names would you like to enter?  ", names%
  10. PRINT
  11.  
  12. DIM fullNames(names%) AS STRING * 18  ' 18 characters each for names
  13. DIM phones(names%) AS STRING * 14     ' 14 characters each for phones
  14.  
  15. FOR i% = 1 TO names%                  ' read values into both arrays
  16.     INPUT "Enter name:  ", fullNames(i%)
  17.     INPUT "Enter phone number:  ", phones(i%)
  18.     PRINT
  19. NEXT i%
  20.  
  21. PRINT "Name                Phone"
  22. PRINT "------------------------------------"
  23.  
  24. FOR i% = 1 TO names%                  ' print contents of both arrays
  25.     PRINT fullNames(i%); "  "; phones(i%)
  26. NEXT i%
  27.  
  28.